package com.alipay.app.groupmeal.standard.http;

import com.alipay.app.groupmeal.standard.http.bean.resp.Result;
import com.alipay.app.groupmeal.standard.http.bean.resp.ShopMachine;
import com.alipay.iot.sdk.utils.SystemUtils;

import io.reactivex.rxjava3.core.Observable;

public class SysRetrofitHelper {
    private SysCenterApiService mApiService;
    private static SysRetrofitHelper helper;

    public static SysRetrofitHelper getInstance() {
        if (helper == null) {
            synchronized (SysRetrofitHelper.class) {
                if (helper == null) {
                    helper = new SysRetrofitHelper();
                }
            }
        }
        return helper;
    }

    private synchronized SysCenterApiService getApiService() {
        if (mApiService == null) {
            mApiService = SysCenterApiEngine.getInstance().getSysApiService();
        }
        return mApiService;
    }

    public Observable<Result<ShopMachine>> bindDevice() {
        return getApiService().findDevice(SystemUtils.getSerialNumber());

    }


}
